<!--
* @description 魔石设置
* @fileName moshiSet.vue
* @author huangyu
* @date 2022/05/23 15:53:32
!-->
<template>
    <div style="margin-top:-20px">
        <el-row :gutter="20">
            <el-col :span="12">
                <el-form label-width="100px">
                    <el-form-item label="强化等级">
                        <el-input placeholder="强化等级" v-model="strong"></el-input>
                    </el-form-item>
                </el-form>
                <el-table :data="typeBaiList" border size="mini">
                    <el-table-column label="魔石名称" prop="name"></el-table-column>
                    <el-table-column label="魔石数量" prop="number">
                        <template slot-scope="scope">
                            <el-input v-model="scope.row.number" size="mini"></el-input>
                        </template>
                    </el-table-column>
                </el-table>
            </el-col>
            <el-col :span="12">
                <el-table :data="typeLvList" border size="mini">
                    <el-table-column label="魔石名称" prop="name"></el-table-column>
                    <el-table-column label="魔石数量" prop="number">
                        <template slot-scope="scope">
                            <el-input v-model="scope.row.number" size="mini"></el-input>
                        </template>
                    </el-table-column>
                </el-table>
            </el-col>
        </el-row>
        <div style="margin-top:20px;text-align:center;">
            <el-button @click="submit" type="primary">确认</el-button>
        </div>
    </div>
</template>

<script>
import {msTypeBai,msTypeLv} from "@/components/game/aion/msType.js"
export default {
    props:{},
    components: {},
    data() {
        return {
            strong: '',
            dialogMSType: false,
            typeBaiList: msTypeBai,
            typeLvList: msTypeLv,
        }
    },
    mounted() {
    },
    methods: {
        submit(){
            // 只传回有数量的魔石信息
            let arr = []
            let model = {}
            this.typeBaiList.forEach(item=>{
                if(item.number){
                    arr.push(item)
                }
            })
            this.typeLvList.forEach(item=>{
                if(item.number){
                    arr.push(item)
                }
            })
            model.msList = arr
            model.strong = this.strong
            this.$emit('MSData',model)
        },
    },
}
</script>

<style scoped>
</style>